import type { DependencyItem } from '@/App'

export const antd5: DependencyItem = {
  libraryName: 'antd',
  libraryGlobalImport: 'antd',
  libraryUrl:
        'https://cdnjs.cloudflare.com/ajax/libs/antd/5.2.1/antd.min.js',
  libraryVersion: '5.2.1',
  moduleConfig: [
    {
      moduleName: 'Button',
      hasSlot: false,
      formPropsConfig: {
        block: {
          type: 'boolean',
          title: '是否区块',
        },
        type: {
          type: 'options',
          title: '按钮类型',
          componentProps: {
            options: [
              {
                label: 'primary',
                value: 'primary',
              },
              {
                label: 'ghost',
                value: 'ghost',
              },
              {
                label: 'dashed',
                value: 'dashed',
              },
              {
                label: 'link',
                value: 'link',
              },
              {
                label: 'text',
                value: 'text',
              },
            ],
          },
        },
        children: {
          type: 'string',
          title: '内容',
        },
        danger: {
          type: 'boolean',
          title: '设置危险按钮',
        },
      },
      defaultProps: {
        children: 'button',
        type: 'primary',
      },
    },
    {
      moduleName: 'Input',
      hasSlot: false,
      formPropsConfig: {
        placeholder: {
          type: 'string',
          title: '输入框占位文本',
        },
        addonBefore: {
          type: 'string',
          title: '前置标签',
        },
        addonAfter: {
          type: 'string',
          title: '后置标签',
        },
        prefix: {
          type: 'string',
          title: '前缀图标',
        },
        suffix: {
          type: 'string',
          title: '后缀图标',
        },
        defaultValue: {
          type: 'string',
          title: '输入框默认值',
        },
        value: {
          type: 'string',
          title: '输入框的值',
        },
      },
      defaultProps: {},
    },
    {
      moduleName: 'Divider',
      hasSlot: false,
      formPropsConfig: {
        type: {
          type: 'options',
          title: '分割线类型',
          componentProps: {
            options: [
              {
                label: '水平',
                value: 'horizontal',
              },
              {
                label: '垂直',
                value: 'vertical',
              },
            ],
          },
        },
        dashed: {
          type: 'boolean',
          title: '是否虚线',
        },
        orientation: {
          type: 'options',
          title: '分割线方向',
          componentProps: {
            options: [
              {
                label: '左对齐',
                value: 'left',
              },
              {
                label: '居中对齐',
                value: 'center',
              },
              {
                label: '右对齐',
                value: 'right',
              },
            ],
          },
        },
      },
      defaultProps: {},
    },
    {
      moduleName: 'Select',
      hasSlot: false,
      formPropsConfig: {
        defaultValue: {
          type: 'string',
          title: '选择框默认值',
        },
        value: {
          type: 'string',
          title: '选择框的值',
        },
        mode: {
          type: 'options',
          title: '选择框模式',
          componentProps: {
            options: [
              {
                label: '单选',
                value: 'single',
              },
              {
                label: '多选',
                value: 'multiple',
              },
              {
                label: '标签',
                value: 'tags',
              },
            ],
          },
        },
      },
      defaultProps: {
        options: [],
        style: {
          width: 200,
        },
      },
    },
    {
      moduleName: 'Card',
      formPropsConfig: {
        size: {
          type: 'valueEnum',
          title: 'card 的尺寸',
          componentProps: {
            valueEnum: {
              default: 'default',
              small: 'small',
            },
          },
        },
        title: {
          type: 'string',
          title: '标题',
        },
        bordered: {
          type: 'boolean',
          title: '是否有边框',
        },
        hoverable: {
          type: 'boolean',
          title: '是否可悬停',
        },
        loading: {
          type: 'boolean',
          title: '是否加载中',
        },
      },
      defaultProps: {
        size: 'default',
        title: null,
        bordered: true,
        hoverable: false,
        loading: false,
      },
    },
    {
      moduleName: 'Form',
      formPropsConfig: {
        layout: {
          title: '表单布局',
          type: 'options',
          componentProps: {
            options: [
              { label: 'horizontal', value: 'horizontal' },
              { label: 'vertical', value: 'vertical' },
              { label: 'inline', value: 'inline' },
            ],
          },
        },
      },
      defaultProps: {},
    },
    {
      moduleName: 'Form.Item',
      formPropsConfig: {
        required: {
          title: '是否必填',
          type: 'boolean',
        },
        label: {
          title: 'label',
          type: 'string',
        },
        name: {
          title: 'name',
          type: 'string',
        },
      },
      defaultProps: {},
    },
    {
      moduleName: 'Tabs',
      hasSlot: false,
      formPropsConfig: {
        items: {
          type: 'options',
          title: '配置选项卡内容',
        },
      },
      defaultProps: {
        items: [
          {
            label: 'label1',
            key: 'label1',
            children: [
              {
                $componentName: 'Slot',
              },
            ],
          },
          {
            label: 'label2',
            key: 'label2',
            children: [
              {
                $componentName: 'Slot',
              },
            ],
          },
        ],
      },
    },
    {
      moduleName: 'Layout',
      hasSlot: true,
      formPropsConfig: {
        className: {
          type: 'string',
          title: '容器类名',
        },
      },
      defaultProps: {},
    },
    {
      moduleName: 'Menu',
      hasSlot: false,
      formPropsConfig: {
        mode: {
          type: 'options',
          title: '菜单模式',
          componentProps: {
            options: [
              {
                label: 'vertical',
                value: 'vertical',
              },
              {
                label: 'horizontal',
                value: 'horizontal',
              },
              {
                label: 'inline',
                value: 'inline',
              },
            ],
          },
        },
        theme: {
          type: 'options',
          title: '菜单主题',
          componentProps: {
            options: [
              {
                label: '亮色',
                value: 'light',
              },
              {
                label: '暗色',
                value: 'dark',
              },
            ],
          },
        },
      },
      defaultProps: {},
    },
    {
      moduleName: 'Pagination',
      hasSlot: false,
      formPropsConfig: {
        total: {
          type: 'number',
          title: '总数',
        },
        pageSize: {
          type: 'number',
          title: '每页条数',
        },
        defaultCurrent: {
          type: 'number',
          title: '默认当前页数',
        },
        current: {
          type: 'number',
          title: '当前页数',
        },
        showSizeChanger: {
          type: 'boolean',
          title: '是否可以改变每页条数',
        },
      },
      defaultProps: {
        total: 0,
        pageSize: 10,
        defaultCurrent: 1,
        showSizeChanger: false,
      },
    },
    {
      moduleName: 'Steps',
      hasSlot: false,
      formPropsConfig: {
        current: {
          type: 'number',
          title: '当前步骤',
        },
        status: {
          type: 'options',
          title: '步骤状态',
          componentProps: {
            options: [
              {
                label: 'wait',
                value: 'wait',
              },
              {
                label: 'process',
                value: 'process',
              },
              {
                label: 'finish',
                value: 'finish',
              },
              {
                label: 'error',
                value: 'error',
              },
            ],
          },
        },
        progressDot: {
          type: 'boolean',
          title: '是否显示进度点',
        },
      },
      defaultProps: {
        current: 0,
        status: 'process',
        progressDot: false,
      },
    },
    {
      moduleName: 'Checkbox',
      hasSlot: false,
      formPropsConfig: {
        checked: {
          type: 'boolean',
          title: '是否选中',
        },
        defaultChecked: {
          type: 'boolean',
          title: '默认是否选中',
        },
        disabled: {
          type: 'boolean',
          title: '是否禁用',
        },
        indeterminate: {
          type: 'boolean',
          title: '是否半选状态',
        },
      },
      defaultProps: {
        checked: false,
        defaultChecked: false,
        disabled: false,
        indeterminate: false,
      },
    },
    {
      moduleName: 'DatePicker',
      hasSlot: false,
      formPropsConfig: {
        format: {
          type: 'string',
          title: '日期格式',
        },
        disabled: {
          type: 'boolean',
          title: '是否禁用',
        },
        placeholder: {
          type: 'string',
          title: '占位符',
        },
        showTime: {
          type: 'boolean',
          title: '是否显示时间',
        },
      },
      defaultProps: {
        value: null,
        defaultValue: null,
        format: 'YYYY-MM-DD',
        disabled: false,
        placeholder: '',
        showTime: false,
      },
    },
    {
      moduleName: 'InputNumber',
      hasSlot: false,
      formPropsConfig: {
        value: {
          type: 'number',
          title: '数值',
        },
        defaultValue: {
          type: 'number',
          title: '默认数值',
        },
        min: {
          type: 'number',
          title: '最小值',
        },
        max: {
          type: 'number',
          title: '最大值',
        },
        step: {
          type: 'number',
          title: '步长',
        },
        disabled: {
          type: 'boolean',
          title: '是否禁用',
        },
      },
      defaultProps: {
        value: null,
        defaultValue: null,
        min: -Infinity,
        max: Infinity,
        step: 1,
        disabled: false,
      },
    },
  ],

}
